import {request} from './request'

export function detail(iid){
  return request({
    url:'/detail',
    params:{
      iid
    }
  })
}
export function recommend(){
  return request({
    url:'/recommend'  
  })
}
export class Goods{
  constructor(itemInfo,columns,shopInfo){
    this.title=itemInfo.title
    this.lowNowPrice=itemInfo.lowNowPrice
    this.desc=itemInfo.desc
    this.oldPrice=itemInfo.oldPrice
    this.price=itemInfo.price
    this.discountBgColor=itemInfo.discountBgColor
    this.discount=itemInfo.discountDesc
    this.realPrice=itemInfo.lowNowPrice
    this.columns=columns
    this.services=shopInfo.services
  }
}
export class Shop{
  constructor(shopInfo){
    this.shoplogo=shopInfo.shopLogo
    this.name=shopInfo.name
    this.csells=shopInfo.cSells
    this.cgoods=shopInfo.cGoods
    this.score=shopInfo.score
    this.allGoodsUrl=shopInfo.allGoodsUrl
  }
}
export class Itemparams{
  constructor(itemParams){
    this.set =itemParams.info.set
    this.tables=itemParams.rule.tables
    this.images=itemParams.info.images?itemParams.info.images:''
  }
}
export class Comment{
  constructor(rate,skuInfo){
    this.user=rate.list[0].user ? rate.list[0].user : ''  
    this.content=rate.list[0] ? rate.list[0].content : ''  
    this.style=rate.list[0] ? rate.list[0].style : ''  
    this.time=rate.list[0] ? rate.list[0].created : ''  
    this.skus=skuInfo.skus
  }
}

// class  student{
//   constructor(name,age){
//     this.name=name
//     this.age=age
//   }
// }
// const g =new student('ayg',17)